package com.sdleyou.treepro.common.task;

import com.sdleyou.treepro.common.service.CertificateManager;
import com.sdleyou.treepro.common.service.UserMissionManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@EnableScheduling
public class CertificateScheduleTask {

    @Autowired
    private CertificateManager certificateManager;

    /**
     * 生成证书
     */
    @Async("taskExecutor")
    @Scheduled(cron = "0 0 0/1 * * ?")
    private void certificateTasks() {
        certificateManager.updateCertificate();
    }
}